package com.hqyj.controller;

import com.hqyj.pojo.Admin;
import com.hqyj.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("user")
public class AdminController {
    @Autowired
    AdminService adminService;

    //加载表格数据
    @RequestMapping("/userList")
    public  HashMap<String,Object> listPage(Admin a){
        return adminService.select(a);
    }
    //修改
    @RequestMapping("/update")
    public HashMap<String,Object>  update(Admin a){
        return adminService.update(a);
    }
    //新增
    @RequestMapping("/add")
    public HashMap<String,Object> add( Admin a){
        return adminService.add(a);
    }

    //删除
    @RequestMapping("/del")
    public HashMap<String,Object> del(Integer id){
        return adminService.del(id);
    }

}
